package service.impl;

import org.springframework.beans.factory.annotation.Autowired;

import po.User;
import po.UserIndex;
import service.UserService;
import dao.index.UserIndexDAO;
import dao.user.UserDAO;

public class UserServiceImpl implements UserService {
	
	@Autowired
	private UserIndexDAO userIndexDAO;
	
	@Autowired
	private UserDAO userDAO;

	@Override
	public UserIndex getUserIndex(String loginname) {
		UserIndex userIndex = userIndexDAO.getUserIndex(loginname);
		return userIndex;
	}

	@Override
	public User getUser(String loginname) {
		User user = userDAO.getUser(loginname);
		return user;
	}

	@Override
	public void updateUser(User user) {
		userDAO.updateUser(user);
	}

	@Override
	public User getUser(String dbUrl, String loginname) {
		return userDAO.getUser(dbUrl, loginname);
	}
	
}
